// 一维差分模版
// [l, r] += k -> f[l] += k, f[r + 1] -= k
#include <iostream>
using namespace std;
const int N = 1e5 + 10;
typedef long long LL;
LL f[N];
LL a[N];
int main()
{
    int n, m;
    cin >> n >> m;
    for(int i = 1;i <= n;i++)
    {
        // cin >> a[i];
        LL x; cin >> x;
        // 利用性质创建差分模版
        f[i] += x; f[i + 1] -= x;
        // f[i] = a[i] - a[i - 1];
    }

    while(m--)
    {
        LL l, r, k;
        cin >> l >> r >> k;
        f[l] += k;
        f[r + 1] -= k;
    }

    for(int i = 1;i <= n;i++)
    {
        // a[i] = a[i - 1] + f[i];
        f[i] = f[i - 1] + f[i];
    }

    for(int i = 1;i <= n;i++) cout << f[i] << " ";
    return 0;
}